package exception;

public class ExceptionApiDemo {
    public static void main(String[] args) {
        System.out.println("程序开始了");
        String str = "abc";
        try {
            System.out.println(Integer.parseInt(str));
        } catch (NumberFormatException e) {
            e.printStackTrace();// 输出错误栈堆信息
            //System.out.println("出错了！");
            String message = e.getMessage();// 获取错误信息
            System.out.println(message);
        }


        System.out.println("程序结束了");
    }
}
